<?php
include('../common/_const.php');
include('../common/common.php');
include('../common/checksession.php');
checksession("../index.php");
include('../../inc/conn.php');
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $sys_title['arc_att'];?></title>
<link href="../images/css1/css.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
function checkform(o){
	if(o.att_name.value==""){
		alert("请填写名称!");
		o.att_name.select();
		return false;
	}	
	if(o.att_id.value==""){
		alert("请填对应代码!");
		o.att_id.select();
		return false;
	}
	reg=/^[a-z]+$/g;
	if(!reg.test(o.att_id.value)){
		alert("只能为小写的字母!");
		o.att_id.select();
		return false;
	}
}
function issudel(o){
	if(window.confirm("确认删除!")){
	 window.location.href="../action/ac_arc_att_del.php?id="+o;
	}
}
</script>
</head>

<body>
<form action="../action/ac_arc_att_add.php" method="post" onsubmit="return checkform(this)">
<table class="table" cellspacing="1" cellpadding="2" width="99%" align="center" 
border="0">
  <tbody>
    <tr>
      <th width="100%" height="25" align="left" class="bg_tr">
      	&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $sys_title['arc_att'];?>
      </th>
    </tr>
    <?php 
		$db=db_connect();
		$sql=select_sql("*","`".PRETABLE."arcatt`","1=1");
		$rs=$db->query($sql);
		while($row=$rs->fetch_assoc()){
	?>
    <tr>
      <td height="23" align="left" class="td_bg">
      <span style="padding-left:8px; padding-right:10px;">名称：<?php echo $row['att_name']; ?></span>
      <span style="padding-left:8px; padding-right:10px;">代码：<?php echo $row['att_id']; ?></span>
      <span style="padding-left:8px; padding-right:10px;"><a href="#" style="color:#30F; text-decoration:underline;" onclick="issudel('<?php echo $row['att_id']; ?>')">删除</a></span>
      </td>
      </tr>
      <?php }
	  $rs->close();
	  $db->close();
	  ?>
    <tr>
      <td height="23" align="left" class="td_bg">
      
        名称:<input name="att_name" type="text" class="cat_input" style="width:80px; margin-right:10px;" value="" maxlength="10" />
        
        代码:<input name="att_id" type="text" class="cat_input" style="width:80px;" value="" maxlength="10" />
        <input type="submit" name="submit" value="新增" class="btn" />
        <input type="hidden" name="gurl" value="<?php echo GetCurUrl(); ?>" />
        
        </td>
      </tr>
  </tbody>
</table>
</form>
</body>
</html>